package bulk_param.modele;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

import javax.swing.JOptionPane;

public class Config {
	
	public Config(){
	}
		Properties prop = new Properties();
		private GetDesktopPath path;
		 
		
		public String getLogin(){
			path = new GetDesktopPath();
			try {
	               //load a properties file
	    		prop.load(new FileInputStream(path.getPath()+"/Contact_Num/contact_num.properties"));	 
//	    		prop.load(new FileInputStream("properties/contact_num.properties"));
	              //get the property value and print it out
	    		System.out.println("LOGIN : " +prop.getProperty("login"));
	 
	    	} catch (IOException ex) {
	    		JOptionPane.showMessageDialog(null,"Le fichier 'contact_num.properties'\nest introuvable","Attention",JOptionPane.WARNING_MESSAGE);
	        }
			return prop.getProperty("login");
		}
		
		public String getPassword(){
			try {
	               //load a properties file
	    		prop.load(new FileInputStream(path.getPath()+"/Contact_Num/contact_num.properties"));
//	    		prop.load(new FileInputStream("properties/contact_num.properties"));
	              //get the property value and print it out
	    		System.out.println("PASSWORD : "+prop.getProperty("password"));
	 
	    	} catch (IOException ex) {
	    		ex.printStackTrace();
	        }
			return prop.getProperty("password");
		}		
    }
	    	 

